package battleship.loop;

import battleship.PluginLoop;
import battleship.player.Player;
import battleship.view.Views;

public class Exit implements PluginLoop{

	@Override
	public String loopGetFunction() {
		
		return "exit";
	}

	@Override
	public String loopGetDescription() {
		return "stopt het spel";
	}

	@Override
	public String loopGetOptions() {
		return null;
	}

	@Override
	public int loopExecFunction(String[] arguments, Player player) {
		for(int i = 0; i < 100; ++i)
		{
			System.out.println();
		}
		System.exit(0);
		return 0;
	}

	@Override
	public boolean loopErrorHandler(int error) {
		//nothing to do game already exited
		return false;
	}

	@Override
	public boolean acceptArguments() {
		return false;
	}

	@Override
	public Views[] loopSupportedViews() {
		return new Views[] { Views.Console };
	}

}
